all: hlog.exe

hlog.exe: hlog_test.c hlog.c hlog.h loser_tree.c loser_tree.h
	gcc -g -Wall -O2 hlog_test.c hlog.c loser_tree.c \
		-o hlog.exe -lpthread -lrt

run: hlog.exe
	./hlog.exe

asan:
	gcc -fsanitize=address -g -Wall -O0 hlog_test.c hlog.c loser_tree.c \
		-o hlog_asan.exe -lpthread -lrt
cov: 
	gcc -fprofile-arcs -ftest-coverage -g -Wall -O2 hlog_test.c hlog.c \
		loser_tree.c -o hlog_cov.exe -lpthread -lrt

clean:
	rm -f *.o hlog *.exe core.* *.log *.mmap *.gcov *.gcno *.gcda

